<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="layout" content="bocMain"/>
    <title>进件作业系统</title>
</head>

<body>
<header class="header-title">客户信息简易申请表</header>
<g:form action="contactApplicationInfoSave" method="post" class="myForm">
    <input type="hidden" name="id" id="id" value="${this?.opportunity?.id}">
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">商户信息</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" id="fullName" name="fullName" value="${this?.opportunity?.account?.name}" placeholder="商户信息" disabled="disabled">
            </div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">产品名称</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input"  id="idNumber" name="idNumber" value="${this?.opportunity?.product?.name}" placeholder="产品名称" disabled="disabled">
            </div>
        </div>
    </div>

    <div class="weui-cells weui-cells_form">
        <div class="weui-cells__title">客户申请信息</div>

        <div class="weui-cell ">
            <div class="weui-cell__hd"><label class="weui-label" >商品品牌</label></div>
            <div class="weui-cell__bd">
               <input class="weui-input" type="text" id="brand" name="brand" placeholder="商品品牌">
            </div>
        </div>
        <div class="weui-cell ">
            <div class="weui-cell__hd"><label class="weui-label" >商品型号</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" id="marque" name="marque" placeholder="商品型号">
            </div>
        </div>
        <div class="weui-cell ">
            <div class="weui-cell__hd"><label class="weui-label" >商品总价</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="number" id="loanAmount" name="loanAmount" placeholder="商品总价">
            </div>
            <div class="weui-cell__hd"><label class="weui-label rightUnit">元</label></div>

        </div>
        <div class="weui-cell ">
            <div class="weui-cell__hd"><label class="weui-label" >申请金额</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="number" id="requestedAmount" name="requestedAmount" placeholder="申请金额">
            </div>
            <div class="weui-cell__hd"><label class="weui-label rightUnit">元</label></div>

        </div>

        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd"><label class="weui-label" >申请期数</label></div>
            <div class="weui-cell__bd">
                <g:select class="weui-select" id="loanDuration" name="loanDuration" from="[6, 12, 24, 36,48, 60, 96]" value="${this?.opportunity?.loanDuration}" noSelection="${['': '申请期数']}"/>
            </div>
        </div>
    </div>
</g:form>

<div class="bigBtn">
    <button type="button" class="weui-btn weui-btn_primary" id="submit">下一步</button>
</div>

<script>
    $(function () {
        $("#submit").click(function () {
            var brand = $("#brand").val().trim();
            if (!brand) {
                helpMessage("请输入商品品牌");
                return;
            }
            var marque = $("#marque").val().trim();
            if (!marque) {
                helpMessage("请输入商品型号");
                return;
            }
            var loanAmount = $("#loanAmount").val().trim();
            if (!loanAmount) {
                helpMessage("请输入商品总价");
                return;
            }
            var requestedAmount = $("#requestedAmount").val().trim();
            if (!requestedAmount) {
                helpMessage("请输入申请金额");
                return;
            }
            var loanDuration = $("#loanDuration").val().trim();
            if (!loanDuration) {
                helpMessage("请输入申请期数");
                return;
            }
            $(".myForm").submit();
        })

        function helpMessage(message) {
            $(".helpMsg").text(message).fadeIn(200);
            setTimeout(function () {
                $(".helpMsg").fadeOut(200);
            }, 2000);
        }


    })


</script>

</body>
</html>
